/* This file is part of Multorg.

Multorg is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

Multorg is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Foobar; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */

using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.IO;
using System.Xml;
using System.Text;
using System.Net.Sockets;
using System.Net;


namespace WeatherPlugin
{
	/// <summary>
	/// Summary description for ctlMain.
	/// </summary>
	public class ctlWeather : System.Windows.Forms.UserControl
    {
        private Label lblFull;
        private Label lblobservation_time;
        private Label lblweather;
        private Label lbltemp_c;
        private Label lblrelative_humidity;
        private Label lblwind_dir;
        private Label lblwind_degrees;
        private Label lblwind_mph;
        private Label lblwind_gust_mph;
        private Label lblpressure_mb;
        private Label lbldewpoint_c;
        private Label lblprecip_1hr_metric;
        private Label lblprecip_today_metric;
        private Label label3;
        private Label label5;
        private Label label6;
        private Label label7;
        private Label label8;
        private Label label9;
        private Label label10;
        private Label label11;
        private Label label12;
        private Label label13;
        private Label label14;
        XmlReader reader;
        HttpWebRequest myHttpWebRequest;
        HttpWebResponse myHttpWebResponse;
        Stream stream;
        private Timer timer1;
        
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components;
        private GroupBox groupBox1;
        private GroupBox groupBox2;
        private XmlReaderSettings sets;

        public void OpenRead() {
            // Creates an HttpWebRequest with the specified URL. 
            myHttpWebRequest = (HttpWebRequest)WebRequest.Create("http://api.wunderground.com/weatherstation/WXCurrentObXML.asp?ID=IMAU01424");
                    // Sends the HttpWebRequest and waits for the response.            
            myHttpWebResponse = (HttpWebResponse)myHttpWebRequest.GetResponse();
            // Gets the stream associated with the response.
            stream = myHttpWebResponse.GetResponseStream();
            //  Encoding encode = System.Text.Encoding.GetEncoding("ISO-8859-9");
            // Pipes the stream to a higher level stream reader with the required encoding format. 
            //  StreamReader readStream = new StreamReader(stream, encode);
            sets = new XmlReaderSettings();
            sets.ProhibitDtd = false;
            sets.CheckCharacters = false;
            sets.IgnoreComments = true;
            sets.IgnoreWhitespace = true;
            sets.ValidationType = ValidationType.None;
            reader = XmlReader.Create(new StreamReader(stream, Encoding.GetEncoding("ISO-8859-9")),sets); 
        }

        public void LiveRead()
        {
            OpenRead();
            while (reader.Read())
            {
                switch (reader.NodeType)
                {
                    case XmlNodeType.Element: // The node is an element.
                        if (reader.Name == "city")
                        {
                            reader.Read();
                            lblFull.Text = reader.Value;
                        }
                        if (reader.Name == "observation_time") { reader.Read(); lblobservation_time.Text = String.Format("{0}", (reader.Value)); }
                        if (reader.Name == "weather") { reader.Read(); lblweather.Text = String.Format("{0}", (reader.Value)); }
                        if (reader.Name == "temp_c") { reader.Read(); lbltemp_c.Text = String.Format("{0} C", (reader.Value)); }
                        if (reader.Name == "relative_humidity") { reader.Read(); lblrelative_humidity.Text = String.Format("{0} %", (reader.Value)); }
                        if (reader.Name == "wind_dir") { reader.Read(); lblwind_dir.Text = String.Format("{0} ", (reader.Value)); }
                        if (reader.Name == "wind_degrees") { reader.Read(); lblwind_degrees.Text = String.Format("{0} st", (reader.Value)); }
                        if (reader.Name == "wind_mph") { reader.Read(); lblwind_mph.Text = String.Format("{0} mph", (reader.Value)); }
                        if (reader.Name == "wind_gust_mph") { reader.Read(); lblwind_gust_mph.Text = String.Format("{0} mph", (reader.Value)); }
                        if (reader.Name == "pressure_mb") { reader.Read(); lblpressure_mb.Text = String.Format("{0} mmHg", (reader.Value)); }
                        if (reader.Name == "dewpoint_c") { reader.Read(); lbldewpoint_c.Text = String.Format("{0} C", (reader.Value)); }
                        if (reader.Name == "precip_1hr_metric") { reader.Read(); lblprecip_1hr_metric.Text = String.Format("{0} mm", (reader.Value)); }
                        if (reader.Name == "precip_today_metric") { reader.Read(); lblprecip_today_metric.Text = String.Format("{0} mm", (reader.Value)); }

                        break;

                }
            }
            CloseRead();
        }

        public void CloseRead()
        {
            myHttpWebResponse.Close();
            // Releases the resources of the Stream.
            stream.Close();
        }

		public ctlWeather()
		{
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();
          //  reader = new XmlDocument();
           // reader.Load("http://api.wunderground.com/weatherstation/WXCurrentObXML.asp?ID=IU015ALU5");

            
			// TODO: Add any initialization after the InitializeComponent call
           // Releases the resources of the response.
           

		}

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Component Designer generated code
		/// <summary> 
		/// Required method for Designer support - do not modify 
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.lblFull = new System.Windows.Forms.Label();
			this.lblobservation_time = new System.Windows.Forms.Label();
			this.lblweather = new System.Windows.Forms.Label();
			this.lbltemp_c = new System.Windows.Forms.Label();
			this.lblrelative_humidity = new System.Windows.Forms.Label();
			this.lblwind_dir = new System.Windows.Forms.Label();
			this.lblwind_degrees = new System.Windows.Forms.Label();
			this.lblwind_mph = new System.Windows.Forms.Label();
			this.lblwind_gust_mph = new System.Windows.Forms.Label();
			this.lblpressure_mb = new System.Windows.Forms.Label();
			this.lbldewpoint_c = new System.Windows.Forms.Label();
			this.lblprecip_1hr_metric = new System.Windows.Forms.Label();
			this.lblprecip_today_metric = new System.Windows.Forms.Label();
			this.label3 = new System.Windows.Forms.Label();
			this.label5 = new System.Windows.Forms.Label();
			this.label6 = new System.Windows.Forms.Label();
			this.label7 = new System.Windows.Forms.Label();
			this.label8 = new System.Windows.Forms.Label();
			this.label9 = new System.Windows.Forms.Label();
			this.label10 = new System.Windows.Forms.Label();
			this.label11 = new System.Windows.Forms.Label();
			this.label12 = new System.Windows.Forms.Label();
			this.label13 = new System.Windows.Forms.Label();
			this.label14 = new System.Windows.Forms.Label();
			this.timer1 = new System.Windows.Forms.Timer(this.components);
			this.groupBox1 = new System.Windows.Forms.GroupBox();
			this.groupBox2 = new System.Windows.Forms.GroupBox();
			this.groupBox1.SuspendLayout();
			this.groupBox2.SuspendLayout();
			this.SuspendLayout();
			// 
			// lblFull
			// 
			this.lblFull.AutoSize = true;
			this.lblFull.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.lblFull.Location = new System.Drawing.Point(301, 15);
			this.lblFull.Name = "lblFull";
			this.lblFull.Size = new System.Drawing.Size(46, 18);
			this.lblFull.TabIndex = 0;
			this.lblFull.Text = "label1";
			// 
			// lblobservation_time
			// 
			this.lblobservation_time.AutoSize = true;
			this.lblobservation_time.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.lblobservation_time.Location = new System.Drawing.Point(371, 15);
			this.lblobservation_time.Name = "lblobservation_time";
			this.lblobservation_time.Size = new System.Drawing.Size(46, 18);
			this.lblobservation_time.TabIndex = 1;
			this.lblobservation_time.Text = "label1";
			// 
			// lblweather
			// 
			this.lblweather.AutoSize = true;
			this.lblweather.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.lblweather.ForeColor = System.Drawing.Color.Red;
			this.lblweather.Location = new System.Drawing.Point(210, 25);
			this.lblweather.Name = "lblweather";
			this.lblweather.Size = new System.Drawing.Size(52, 18);
			this.lblweather.TabIndex = 2;
			this.lblweather.Text = "label2";
			// 
			// lbltemp_c
			// 
			this.lbltemp_c.AutoSize = true;
			this.lbltemp_c.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.lbltemp_c.ForeColor = System.Drawing.Color.Red;
			this.lbltemp_c.Location = new System.Drawing.Point(210, 76);
			this.lbltemp_c.Name = "lbltemp_c";
			this.lbltemp_c.Size = new System.Drawing.Size(52, 18);
			this.lbltemp_c.TabIndex = 3;
			this.lbltemp_c.Text = "label3";
			// 
			// lblrelative_humidity
			// 
			this.lblrelative_humidity.AutoSize = true;
			this.lblrelative_humidity.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.lblrelative_humidity.ForeColor = System.Drawing.Color.Red;
			this.lblrelative_humidity.Location = new System.Drawing.Point(210, 47);
			this.lblrelative_humidity.Name = "lblrelative_humidity";
			this.lblrelative_humidity.Size = new System.Drawing.Size(52, 18);
			this.lblrelative_humidity.TabIndex = 5;
			this.lblrelative_humidity.Text = "label5";
			// 
			// lblwind_dir
			// 
			this.lblwind_dir.AutoSize = true;
			this.lblwind_dir.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.lblwind_dir.ForeColor = System.Drawing.Color.Red;
			this.lblwind_dir.Location = new System.Drawing.Point(200, 27);
			this.lblwind_dir.Name = "lblwind_dir";
			this.lblwind_dir.Size = new System.Drawing.Size(52, 18);
			this.lblwind_dir.TabIndex = 7;
			this.lblwind_dir.Text = "label7";
			// 
			// lblwind_degrees
			// 
			this.lblwind_degrees.AutoSize = true;
			this.lblwind_degrees.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.lblwind_degrees.ForeColor = System.Drawing.Color.Red;
			this.lblwind_degrees.Location = new System.Drawing.Point(200, 56);
			this.lblwind_degrees.Name = "lblwind_degrees";
			this.lblwind_degrees.Size = new System.Drawing.Size(52, 18);
			this.lblwind_degrees.TabIndex = 8;
			this.lblwind_degrees.Text = "label8";
			// 
			// lblwind_mph
			// 
			this.lblwind_mph.AutoSize = true;
			this.lblwind_mph.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.lblwind_mph.ForeColor = System.Drawing.Color.Red;
			this.lblwind_mph.Location = new System.Drawing.Point(200, 85);
			this.lblwind_mph.Name = "lblwind_mph";
			this.lblwind_mph.Size = new System.Drawing.Size(52, 18);
			this.lblwind_mph.TabIndex = 9;
			this.lblwind_mph.Text = "label9";
			// 
			// lblwind_gust_mph
			// 
			this.lblwind_gust_mph.AutoSize = true;
			this.lblwind_gust_mph.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.lblwind_gust_mph.ForeColor = System.Drawing.Color.Red;
			this.lblwind_gust_mph.Location = new System.Drawing.Point(200, 119);
			this.lblwind_gust_mph.Name = "lblwind_gust_mph";
			this.lblwind_gust_mph.Size = new System.Drawing.Size(52, 18);
			this.lblwind_gust_mph.TabIndex = 10;
			this.lblwind_gust_mph.Text = "label1";
			// 
			// lblpressure_mb
			// 
			this.lblpressure_mb.AutoSize = true;
			this.lblpressure_mb.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.lblpressure_mb.ForeColor = System.Drawing.Color.Red;
			this.lblpressure_mb.Location = new System.Drawing.Point(210, 103);
			this.lblpressure_mb.Name = "lblpressure_mb";
			this.lblpressure_mb.Size = new System.Drawing.Size(52, 18);
			this.lblpressure_mb.TabIndex = 11;
			this.lblpressure_mb.Text = "label2";
			// 
			// lbldewpoint_c
			// 
			this.lbldewpoint_c.AutoSize = true;
			this.lbldewpoint_c.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.lbldewpoint_c.ForeColor = System.Drawing.Color.Red;
			this.lbldewpoint_c.Location = new System.Drawing.Point(464, 92);
			this.lbldewpoint_c.Name = "lbldewpoint_c";
			this.lbldewpoint_c.Size = new System.Drawing.Size(52, 18);
			this.lbldewpoint_c.TabIndex = 12;
			this.lbldewpoint_c.Text = "label3";
			// 
			// lblprecip_1hr_metric
			// 
			this.lblprecip_1hr_metric.AutoSize = true;
			this.lblprecip_1hr_metric.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.lblprecip_1hr_metric.ForeColor = System.Drawing.Color.Red;
			this.lblprecip_1hr_metric.Location = new System.Drawing.Point(464, 116);
			this.lblprecip_1hr_metric.Name = "lblprecip_1hr_metric";
			this.lblprecip_1hr_metric.Size = new System.Drawing.Size(52, 18);
			this.lblprecip_1hr_metric.TabIndex = 13;
			this.lblprecip_1hr_metric.Text = "label5";
			// 
			// lblprecip_today_metric
			// 
			this.lblprecip_today_metric.AutoSize = true;
			this.lblprecip_today_metric.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.lblprecip_today_metric.ForeColor = System.Drawing.Color.Red;
			this.lblprecip_today_metric.Location = new System.Drawing.Point(464, 139);
			this.lblprecip_today_metric.Name = "lblprecip_today_metric";
			this.lblprecip_today_metric.Size = new System.Drawing.Size(52, 18);
			this.lblprecip_today_metric.TabIndex = 14;
			this.lblprecip_today_metric.Text = "label1";
			// 
			// label3
			// 
			this.label3.AutoSize = true;
			this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.label3.Location = new System.Drawing.Point(37, 20);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(64, 18);
			this.label3.TabIndex = 17;
			this.label3.Text = "Weather";
			// 
			// label5
			// 
			this.label5.AutoSize = true;
			this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.label5.Location = new System.Drawing.Point(37, 76);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(50, 18);
			this.label5.TabIndex = 18;
			this.label5.Text = "Temp:";
			this.label5.Click += new System.EventHandler(this.label5_Click);
			// 
			// label6
			// 
			this.label6.AutoSize = true;
			this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.label6.Location = new System.Drawing.Point(36, 47);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(65, 18);
			this.label6.TabIndex = 19;
			this.label6.Text = "Humidity";
			// 
			// label7
			// 
			this.label7.AutoSize = true;
			this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.label7.Location = new System.Drawing.Point(22, 27);
			this.label7.Name = "label7";
			this.label7.Size = new System.Drawing.Size(66, 18);
			this.label7.TabIndex = 21;
			this.label7.Text = "Wind dir:";
			// 
			// label8
			// 
			this.label8.AutoSize = true;
			this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.label8.Location = new System.Drawing.Point(22, 56);
			this.label8.Name = "label8";
			this.label8.Size = new System.Drawing.Size(83, 18);
			this.label8.TabIndex = 22;
			this.label8.Text = "Wind_degr:";
			// 
			// label9
			// 
			this.label9.AutoSize = true;
			this.label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.label9.Location = new System.Drawing.Point(22, 85);
			this.label9.Name = "label9";
			this.label9.Size = new System.Drawing.Size(86, 18);
			this.label9.TabIndex = 23;
			this.label9.Text = "Wind speed";
			// 
			// label10
			// 
			this.label10.AutoSize = true;
			this.label10.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.label10.Location = new System.Drawing.Point(22, 119);
			this.label10.Name = "label10";
			this.label10.Size = new System.Drawing.Size(122, 18);
			this.label10.TabIndex = 24;
			this.label10.Text = "Wind gust speed:";
			// 
			// label11
			// 
			this.label11.AutoSize = true;
			this.label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.label11.Location = new System.Drawing.Point(37, 103);
			this.label11.Name = "label11";
			this.label11.Size = new System.Drawing.Size(72, 18);
			this.label11.TabIndex = 25;
			this.label11.Text = "Pressure:";
			// 
			// label12
			// 
			this.label12.AutoSize = true;
			this.label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.label12.Location = new System.Drawing.Point(355, 94);
			this.label12.Name = "label12";
			this.label12.Size = new System.Drawing.Size(78, 18);
			this.label12.TabIndex = 26;
			this.label12.Text = "Dew point:";
			this.label12.Click += new System.EventHandler(this.label12_Click);
			// 
			// label13
			// 
			this.label13.AutoSize = true;
			this.label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.label13.Location = new System.Drawing.Point(352, 115);
			this.label13.Name = "label13";
			this.label13.Size = new System.Drawing.Size(75, 18);
			this.label13.TabIndex = 27;
			this.label13.Text = "Precip 1hr";
			this.label13.Click += new System.EventHandler(this.label13_Click);
			// 
			// label14
			// 
			this.label14.AutoSize = true;
			this.label14.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.label14.Location = new System.Drawing.Point(347, 139);
			this.label14.Name = "label14";
			this.label14.Size = new System.Drawing.Size(94, 18);
			this.label14.TabIndex = 28;
			this.label14.Text = "Precip today:";
			this.label14.Click += new System.EventHandler(this.label14_Click);
			// 
			// timer1
			// 
			this.timer1.Enabled = true;
			this.timer1.Interval = 30000;
			this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
			// 
			// groupBox1
			// 
			this.groupBox1.Controls.Add(this.label7);
			this.groupBox1.Controls.Add(this.lblwind_dir);
			this.groupBox1.Controls.Add(this.label8);
			this.groupBox1.Controls.Add(this.lblwind_degrees);
			this.groupBox1.Controls.Add(this.label9);
			this.groupBox1.Controls.Add(this.label10);
			this.groupBox1.Controls.Add(this.lblwind_mph);
			this.groupBox1.Controls.Add(this.lblwind_gust_mph);
			this.groupBox1.Location = new System.Drawing.Point(19, 54);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(296, 160);
			this.groupBox1.TabIndex = 29;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "Wind";
			// 
			// groupBox2
			// 
			this.groupBox2.Controls.Add(this.label3);
			this.groupBox2.Controls.Add(this.lblweather);
			this.groupBox2.Controls.Add(this.lbltemp_c);
			this.groupBox2.Controls.Add(this.lblrelative_humidity);
			this.groupBox2.Controls.Add(this.label5);
			this.groupBox2.Controls.Add(this.label11);
			this.groupBox2.Controls.Add(this.label6);
			this.groupBox2.Controls.Add(this.lblpressure_mb);
			this.groupBox2.Location = new System.Drawing.Point(19, 230);
			this.groupBox2.Name = "groupBox2";
			this.groupBox2.Size = new System.Drawing.Size(296, 136);
			this.groupBox2.TabIndex = 30;
			this.groupBox2.TabStop = false;
			this.groupBox2.Text = "Weather";
			// 
			// ctlWeather
			// 
			this.BackColor = System.Drawing.Color.White;
			this.Controls.Add(this.groupBox2);
			this.Controls.Add(this.groupBox1);
			this.Controls.Add(this.label14);
			this.Controls.Add(this.label13);
			this.Controls.Add(this.label12);
			this.Controls.Add(this.lblprecip_today_metric);
			this.Controls.Add(this.lblprecip_1hr_metric);
			this.Controls.Add(this.lbldewpoint_c);
			this.Controls.Add(this.lblobservation_time);
			this.Controls.Add(this.lblFull);
			this.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(238)));
			this.Name = "ctlWeather";
			this.Size = new System.Drawing.Size(666, 431);
			this.Load += new System.EventHandler(this.ctlMain_Load);
			this.groupBox1.ResumeLayout(false);
			this.groupBox1.PerformLayout();
			this.groupBox2.ResumeLayout(false);
			this.groupBox2.PerformLayout();
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion

		private void butOpenFile_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
		{
			
			
		}

		private void butSaveFile_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
		{
			
		}

		private void ctlMain_Load(object sender, System.EventArgs e)
		{
		    //
           
            LiveRead();

            
		}

        private void timer1_Tick(object sender, EventArgs e)
        {
            LiveRead();
        }

        private void label5_Click(object sender, EventArgs e)
        {

        }

        private void label12_Click(object sender, EventArgs e)
        {

        }

        private void label13_Click(object sender, EventArgs e)
        {

        }

        private void label14_Click(object sender, EventArgs e)
        {

        }
	}
}
